export const routes = [
  // 认证相关路由
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/auth/Login.vue'),
    meta: { 
      title: '登录',
      requiresAuth: false,
      layout: 'auth'
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/auth/Register.vue'),
    meta: { 
      title: '注册',
      requiresAuth: false,
      layout: 'auth'
    }
  },
  {
    path: '/forgot-password',
    name: 'ForgotPassword',
    component: () => import('@/views/auth/ForgotPassword.vue'),
    meta: { 
      title: '忘记密码',
      requiresAuth: false,
      layout: 'auth'
    }
  },
  // 主应用路由
  {
    path: '/',
    component: () => import('@/layouts/MainLayout.vue'),
    meta: { requiresAuth: true },
    children: [
      {
        path: '',
        redirect: '/dashboard'
      },
      {
        path: '/dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/Dashboard.vue'),
        meta: { 
          title: '仪表盘',
          icon: 'dashboard',
          requiresAuth: true
        }
      },
      {
        path: '/documents',
        name: 'Documents',
        component: () => import('@/views/documents/DocumentList.vue'),
        meta: { 
          title: '文档管理',
          icon: 'document',
          requiresAuth: true,
          requiresAdmin: true
        }
      },
      {
        path: '/documents/upload',
        name: 'DocumentUpload',
        component: () => import('@/views/documents/DocumentUpload.vue'),
        meta: { 
          title: '文档上传',
          icon: 'upload',
          requiresAuth: true,
          requiresAdmin: true
        }
      },
      {
        path: '/users',
        name: 'Users',
        component: () => import('@/views/users/UserList.vue'),
        meta: { 
          title: '用户管理',
          icon: 'users',
          requiresAuth: true,
          requiresAdmin: true
        }
      },
      {
        path: '/conversations',
        name: 'Conversations',
        component: () => import('@/views/conversations/ConversationList.vue'),
        meta: { 
          title: '对话历史',
          icon: 'history',
          requiresAuth: true,
          requiresAdmin: true
        }
      },
      {
        path: '/profile',
        name: 'Profile',
        component: () => import('@/views/profile/Profile.vue'),
        meta: {
          title: '个人资料',
          icon: 'user',
          requiresAuth: true
        }
      }
    ]
  },
  // 404 页面
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/NotFound.vue'),
    meta: { 
      title: '页面未找到'
    }
  }
]